package me.magicall.db.dao;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import me.magicall.db.util.PageInfo;

/**
 * 与表有关的dao,最简单的情况只需要一个对数据库表名的映射关系.
 * 
 * @author MaGiCalL
 * @param <T>
 */
public interface Dao<T> extends CommonDao<T> {

	T get(Comparable<?> id);

	/**
	 * 支持in
	 * 
	 * @param paramMap accept both dbColumnName or javaFieldName
	 * @param offset
	 * @param size
	 * @return
	 */
	List<T> getList(Map<String, ?> paramMap, PageInfo pageInfo);

	List<T> getList(Map<String, ?> paramMap, int size);

	List<T> getList(Map<String, ?> paramMap);

	int count(Map<String, ?> paramMap);

	Collection<T> listUsingIds(Object... ids);

	Collection<T> listUsingIds(Collection<? extends Object> ids);

	Collection<T> all();

	int allCount();

	int del(Comparable<?> id);
}
